home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / Jooky / findhedder.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-01  |  313 b   |  21 lines

  1. #include "includes.h"
  2.  
  3. long findhedder(FILE *inp)
  4. {
  5.     int a,b;
  6.  
  7.     while ((a=fgetc(inp))!=EOF)
  8.     {
  9.         fseek(inp,-1,SEEK_CUR);
  10.         a=fgetc(inp);
  11.         b=fgetc(inp);
  12.         fseek(inp,-2,SEEK_CUR);
  13.         if ((a==0xFF)&((b==0xFB)|(b==0xFA)))
  14.         {
  15.             return (ftell(inp));
  16.         }
  17.         fseek(inp,1,SEEK_CUR);
  18.     }
  19.     return EOF;
  20. }
  21.